<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="jQuery/jquery-2.1.1.min.js"></script>
<script src="jQuery/jquery-ui.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("#button1").click(
						function() {$.ajax({
										type : "POST",
										url : "Ajax-xml",
										dateType : "xml",
										data : {
											'log.id' : $("#param1").val(),
											'log.msg' : $("#param2").val()
										},
										success : function(xml) {
											var id = $(xml).find("id").text();
											var msg = $(xml).find("msg").text();
											var html = "<table width='60%' border='1' align='center'>"
													 + "<tr><th>id</th><th>msg</th></tr><tr><td>"
													 + id+ "</td><td>"+ msg+ "</td></tr></table>";
											$("#theBody table:eq(0)").remove();
											$("#theBody").append(html);
										},
										error : function() {
											alert('xml解析错误');
										}

									});

						});
	});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body id="theBody">
	<input type="text" id="param1">
	<input type="text" id="param2">
	<input type="text" id="result">
	<input type="button" value="get content from server" id="button1">


</body>
</html>